import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/user/Login'
import Register from '@/components/user/Register'
import Main from '@/components/main/Main'
import Home from '@/components/main/Home'
import HistoryOrder from '@/components/main/HistoryOrder'
import Mine from '@/components/main/Mine'
import Address from '@/components/mine/Address'
import Allowance from '@/components/mine/Allowance'
import Collection from '@/components/mine/Collection'
import RedEnvelop from '@/components/mine/RedEnvelop'
import Service from '@/components/mine/Service'
import RuleCenter from '@/components/mine/RuleCenter'
import AddressChange from '@/components/mine_extra/AddressChange'
import StoreClassification from '@/components/mine_extra/StoreClassification'
import StoreSearch from '@/components/mine_extra/StoreSearch'
import Comment from '@/components/store/Comment'
import Menu from '@/components/store/Menu'
import Merchant from '@/components/store/Merchant'
import Store from '@/components/store/Store'
import ConfirmOrder from '@/components/order/ConfirmOrder'
import Evaluation from '@/components/order/Evaluation'
import SuccessfulPay from '@/components/order/SuccessfulPay'
import OrderDetail from '@/components/order/OrderDetail'


Vue.use(Router);

export default
  [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/main',
      redirect: '/main/home',
      component: Main,
      children: [
        {
          path: 'home',
          component: Home
        },
        {
          path: 'historyOrder',
          component: HistoryOrder
        },
        {
          path: 'mine',
          component: Mine
        }
      ]
    },
    {
      path: '/address',
      name: '我的收货地址',
      component: Address
    },
    {
      path: '/allowance',
      name: '津贴联盟',
      component: Allowance
    },
    {
      path: '/collection',
      name: '我的收藏',
      component: Collection
    },
    {
      path: '/redEnvelop',
      name: '红包',
      component: RedEnvelop
    },
    {
      path: '/service',
      name: '我的客服',
      component: Service
    },
    {
      path: '/ruleCenter',
      name: '资质与规则',
      component: RuleCenter
    },
    {
      path: '/addressChange',
      name: 'AddressChange',
      component: AddressChange
    },
    {
      path: '/storeClassification',
      name: 'StoreClassification',
      component: StoreClassification
    },
    {
      path: '/storeSearch',
      name: '搜索',
      component: StoreSearch
    },
    {
      path: '/store',
      redirect: '/store/menu',
      component: Store,
      children: [
        {
          path: 'merchant',
          component: Merchant
        },
        {
          path: 'menu',
          component: Menu
        },
        {
          path: 'comment',
          component: Comment
        }
      ]
    },
    {
      path: '/confirmOrder',
      name: 'ConfirmOrder',
      component: ConfirmOrder
    },
    {
      path: '/evaluation',
      name: '发表评价',
      component: Evaluation
    },{
      path: '/successfulPay',
      name: 'SuccessfulPay',
      component: SuccessfulPay
    },
    {
      path: '/orderDetail',
      name: 'OrderDetail',
      component: OrderDetail
    },

  ]
